Skip to content

Conversation

hiroshihorie
Copy link
Member

Throws different type of error if server validation failed

@pblazej
Copy link
Contributor

pblazej commented Sep 11, 2025

No more flaky tests? 😄

Hm, looks like this is still related? Is it just ACK (202)?

testParticipantCleanUp, failed: caught error: "Error Domain=io.livekit.swift-sdk Code=202 "Network error(Unknown)" UserInfo={NSLocalizedDescription=Network error(Unknown)}"

case valid
case invalid(message: String)
// Network error etc.
case unknown(error: Error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO either throws/Result/Error where throws should be prioritized

@pblazej
Copy link
Contributor

pblazej commented Oct 15, 2025

Let's unblock this PR, 2 nitpicks:

  • ServerValidationResponse should be valid/invalid + the method throws
  • let's maybe revert this line throw LiveKitError(.cancelled, internalError: error)

Othwerwise, LGTM 🌮

@hiroshihorie hiroshihorie requested a review from pblazej October 19, 2025 12:12
case webRTC = 201

case network // Network issue
case validation // Network issue
Copy link
Contributor

@pblazej pblazej Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd rename that to authorization (or better?), as this is very generic (not sure about other SDKs).

Otherwise LGTM^2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we used to call this "validation", the endpoint (path is /validate)

pathSegments.append("validate")

So maybe validation is better ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that matches backend, then why not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants